<script setup>
const props = defineProps({
  list: Array
})

const toWorkInfo = (id)=>{
  uni.navigateTo({
  url: `/components/workInfo?workId=${id}`
});
}
</script>
<template>
  <div class="container">
    <div class="single-card" v-for="(item, index) in list" :key="index" @click="toWorkInfo(item.workId)">
      <img
        :src="item.indexImg"
        alt=""
        style="max-width: 100%; max-height: 100%"
      />
    </div>
  </div>
</template>
<style scoped>
.single-card {
  margin: 0rpx 5rpx 5rpx 0rpx;
  width: 370rpx;
}
.container {
  margin-top: 5rpx;
  display: flex;
  flex-direction: row;
  justify-content: space-between; /* 项目之间均匀分布 */
  flex-wrap: wrap; /* 允许子项换行 */
}
</style>
